package com.unitspirit.sample;

public enum EnumSample3 {
    WE("_WE", "智能算法"), WR("_WR", "伪随机"), WP("_WP", "私有方法"), WG("_WG", "回放算法");

    private final String typeName;
    private final String typeDesc;

    EnumSample3(String typeName, String typeDesc) {
        this.typeName = typeName;
        this.typeDesc = typeDesc;
    }

    /**
     * 根据类型的名称，返回类型的枚举实例。
     *
     * @param typeName 类型名称
     */
    public static EnumSample3 fromTypeName(String typeName) {
        typeName = typeName.toLowerCase();
        for (EnumSample3 type : EnumSample3.values()) {
            if (type.getTypeName().equals(typeName)) {
                return type;
            }
        }
        return null;
    }

    public String getTypeName() {
        return this.typeName;
    }

    public String getTypeDesc() {
        return this.typeDesc;
    }
}
